package labs;

import java.util.Scanner;
/*
 * Pide entero y muestra  suma de digitos pares
 * 
 * 135 
 * suma = 0
 * 
 * 1234 
 * suma = 6
 * 
 */

public class DemoWhile04 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Valor: ");
        String vslor = scanner.nextLine();

        int x = Integer.valueOf(vslor).intValue();

        int sum = 0;
        while (x > 0) {
            int dig = (x % 10);

            sum += ((dig % 2) == 0) ? dig : 0;

            x -= dig;
            x /= 10;
        }
        System.out.println("La suma es:" + sum);
    }
}
